package yjy;

import java.util.Scanner;


public class Main 
{
    public static void main(String[] args)
    {
	  Scanner sc=new Scanner(System.in);
	  int n=sc.nextInt();
	  Person[] person=new Person[n];
	  
	  for(int i=0;i<n;i++)
	  {
		  person[i]=new Person(sc.next(), sc.nextInt(), sc.nextBoolean());
	  }
	  
	  for(int i=n-1;i>=0;i--)
	  {
		  System.out.println(person[i].toString());
	  }
	  
	  Person p=new Person();
	  p.printall();
	  System.out.println(p);
    }		
}

class Person
{
	private String name;
	private boolean gender;
	private int age;
	private int id;
	static int index;
	{
		this.id=index++;
		System.out.println("This is initialization block, id is "+this.id);
		
	}
	
	static
	{
		System.out.println("This is static initialization block");
	}
	Person()
	{
		System.out.println("This is constructor");
	}
	
	Person(String name,int age,boolean gender)
	{
		
		this.name=name;
		this.age=age;
		this.gender=gender;
	}


	@Override
	public String toString() {
		return "Person [name=" + name + ", age=" + age+", gender=" + gender 
				+ ", id=" + id + "]";
	}
	
	 public void printall()
	{
		System.out.println(this.name+','+this.age+','+this.gender+','+this.id);
	}
}
